<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="root">
    父组件
    <br>
    <hello :gettext="text"></hello>
  </div>

  <script src="./libs/vue.js"></script>
  <script>
    new Vue({
      el: '#root',
      data: {
        text: '这是需要传递给子组件的数据'
      },
      components: {
        'hello': {
          template: `
            <div>
              子组件

              {{gettext}}
            </div>
          `,
          props: ['gettext']
        }
      }
    })
  </script>
</body>
</html>